package com.exam.qc.client;



import com.exam.qc.fallback.ProductFeignClientFallback;
import com.exam.qc.model.Product;
import com.exam.qc.model.ReturnVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;



@FeignClient(name = "QC-CLOUD-PROVIDER", fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {


    /**
     * 分页查询产品信息接口
     * @param productName
     * @param pageNo
     * @param pageSize
     * @return
     */
    @RequestMapping(value = "/product/search")
    ReturnVo listPage(
            @RequestParam(value = "productName",required = true,defaultValue = "")String productName,
            @RequestParam(value = "pageNo",required = true,defaultValue = "1") Integer pageNo,
            @RequestParam(value = "pageSize",required = true,defaultValue = "2") Integer pageSize

    );



    /**
     * 查询所有产品列表接口
     * @return
     */
    @RequestMapping(value = "/product/list")
    ReturnVo getProList();



    /**
     * 新增产品接口
     * @param product
     * @return
     */
    @RequestMapping(value = "/product/save",consumes = "application/json")
    ReturnVo saveProduct(@RequestBody Product product);

}
